<?
include("/var/www/html/new/com.inc.php");
$lid=$_REQUEST["id"];
if(substr($lid,0,1)=="r"){exit("<script>alert('线路产品暂不可点评,敬请谅解');history.go(-1);</script>");}
$ordid=$_REQUEST["ordid"];
$uri=urldecode($_REQUEST["u"]);
$qrimg=$_REQUEST["qrimg"];
$sel="select title from uu_land where id = ".$lid;
$GLOBALS['le']->query($sel);
$GLOBALS['le']->fetch_assoc();
$title=$GLOBALS['le']->f("title");
//总分
$cslist=array();
$cssum=0;
$sel="select cscore,content,cdate,uname from uu_jq_comment left join uu_member on memid=did where landid = '".$lid."'";
$GLOBALS['le']->query($sel);
while($row=$GLOBALS['le']->fetch_assoc()){
	$cslist[]=$row;
}
foreach($cslist as $list){
	$cscore=explode("|",$list['cscore']);
	$cssum+=(int)$cscore[0];
}
$plsum=count($cslist);//点评人数
$pf=$plsum ? $cssum/$plsum : 0;//评分平均分
$pfint=floor($pf);//平均分向下取整
$pos=$pfint*2;//图片位置
if($pf>$pfint+0.5){//根据小数点调整
	$pos++;
	$pfint+=0.5;
}
if(!$plsum){
	$pos=6;
	$pfint=3;
}
$pospx=(10-$pos)*(-13);
?>
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
<title>驴友评价</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!--头部开始-->
<header>
  <section class="head"><h1><?=$title?></h1></section>
</header>
<!--头部结束-->

<!--点评信息开始-->
<section class="ping">
	<section class="ping_star">
    	<section class="ping_star_">
        	<div class="star_5"></div><span>共<?=$plsum?>封点评</span>
        </section>
    </section>
    <section class="ping_text"><span><?=$pfint?></span>分</section>
    <section class="ping_but"><a href="wdpj.html?lid=<?=$lid?>&ordid=<?=$ordid?>&u=<?=urlencode($uri)?>">我要点评</a></section>
</section>
<section class="ping_list">
	<ul>
<?foreach($cslist as $list){
	$cscore=explode("|",$list['cscore']);
	$zg=ceil((int)$cscore[0]);
	$name=$list['uname']?$list['uname']:"游客";
	$content=explode("|",$list['content'])?>
    <li>
   		<section class="ping_1"><b><?=$name?>：</b><div class="star_<?=$zg?>"></div><span><?=$list['cdate']?></span></section>
    	<section class="ping_2"><?=$content[1]?></section>
    </li>
<?}?>
    </ul>
</section>
<!--点评信息结束-->
<?include("foot.html");?>
</body>
</html>